<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateHkDeviceGroupTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void 
    {
        Schema::create('hk_device_group', function (Blueprint $table) {
            $table->engine = 'Innodb';
            $table->comment('海康设备分组');
            $table->string('group_id', 64)->nullable(false)->comment('group_id分组ID');
            $table->string('group_name', 64)->nullable(false)->comment('组名称');
            $table->string('group_no', 64)->nullable(false)->comment('组编号');
            $table->string('parent_id', 64)->nullable()->comment('父节点id');
            $table->primary('group_id');
            $table->datetimes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('hk_device_group');
    }
}
